public class UserController {  
  
    private UserService userService;
  
    public UserController(UserService userService) {  
        this.userService = userService;  
    }  
  
    // 登录方法  
    public User login(String username, String password) {  
        // 调用UserService的login方法  
        return userService.login(username, password);  
    }  
  
    // 注册方法  
    public boolean reg(User user) {  
        // 调用UserService的reg方法  
        return userService.reg(user);  
    }  
}
}
